<template>
  <div :style="{ margin: '0 auto', width: '100%' }">
    <el-row :gutter="60" class="main">
      <el-form ref="formRef" :model="dataForm" :rules="dataRule" size="medium" label-width="100px" label-position="top"
               :disabled="setting.readonly">
        <template v-if="!loading && formOperates">
          <!-- 具体表单 -->
          <el-col :span="4">
            <el-row :gutter="30">
              <el-col :span="24">
                <jnpf-form-tip-item>
                  <JnpfText
                    :textStyle='{ "color": "#000000", "font-weight": "normal", "text-decoration": "none", "font-size": 12, "line-height": 32, "font-style": "normal", "text-align": "left" }'>
                  </JnpfText>
                </jnpf-form-tip-item>
              </el-col>
            </el-row>
          </el-col>
          <el-col :span="16" class="project-main">
            <el-row :gutter="30">
              <el-col :span="24">
                <jnpf-form-tip-item>
                  <JnpfText
                    :textStyle='{ "color": "#1684FC", "font-weight": "bold", "text-decoration": "none", "font-size": 24, "line-height": 32, "font-style": "normal", "text-align": "center" }'
                    content="福州市中小企业数字化转型试点被改造企业项目表">
                  </JnpfText>
                  <el-button type="danger" round class="print-button"
                             icon="icon-ym icon-ym-report-icon-preview-printPreview" @click="printDialog()">打 印
                  </el-button>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('enterpriseName')">
                <jnpf-form-tip-item label="企业名称" v-if="judgeShow('enterpriseName')" prop="enterpriseName">
                  <JnpfInput v-model="dataForm.enterpriseName" @change="changeData('enterpriseName', -1)"
                             placeholder="请输入" :disabled="judgeWrite('enterpriseName')" readonly clearable
                             :style='{ "width": "100%" }'>
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('enterpriseCreditCode')">
                <jnpf-form-tip-item label="企业信用代码" v-if="judgeShow('enterpriseCreditCode')" label-width="115px"
                                    prop="enterpriseCreditCode">
                  <JnpfInput v-model="dataForm.enterpriseCreditCode" @change="changeData('enterpriseCreditCode', -1)"
                             placeholder="请输入" :disabled="judgeWrite('enterpriseCreditCode')" readonly clearable
                             :style='{ "width": "100%" }'>
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="24" v-if="judgeShow('enterpriseIntroduce')">
                <jnpf-form-tip-item label="企业简介" v-if="judgeShow('enterpriseIntroduce')" prop="enterpriseIntroduce">
                  <JnpfTextarea v-model="dataForm.enterpriseIntroduce" @change="changeData('enterpriseIntroduce', -1)"
                                placeholder="请输入" :disabled="judgeWrite('enterpriseIntroduce')"
                                :style='{ "width": "100%" }' true
                                type="textarea" :autosize='{ "minRows": 6, "maxRows": 10 }'>
                  </JnpfTextarea>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="16" v-if="judgeShow('projectName')">
                <jnpf-form-tip-item label="项目名称" v-if="judgeShow('projectName')" prop="projectName">
                  <JnpfInput v-model="dataForm.projectName" @change="changeData('projectName', -1)" placeholder="请输入"
                             :disabled="judgeWrite('projectName')" clearable :style='{ "width": "100%" }'>
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('projectLeader')">
                <jnpf-form-tip-item label="项目负责人" v-if="judgeShow('projectLeader')" prop="projectLeader">
                  <JnpfInput v-model="dataForm.projectLeader" @change="changeData('projectLeader', -1)"
                             placeholder="请输入" :disabled="judgeWrite('projectLeader')" clearable
                             :style='{ "width": "100%" }'>
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('phone')">
                <jnpf-form-tip-item label="联系电话" v-if="judgeShow('phone')" prop="phone">
                  <JnpfInput v-model="dataForm.phone" @change="changeData('phone', -1)" placeholder="请输入"
                             :disabled="judgeWrite('phone')" clearable :style='{ "width": "100%" }'>
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('industry')">
                <jnpf-form-tip-item label="所属行业" v-if="judgeShow('industry')" prop="industry">
                  <JnpfInput v-model="dataForm.industry" @change="changeData('industry', -1)" placeholder="请输入"
                             :disabled="judgeWrite('industry')" readonly clearable :style='{ "width": "100%" }'>
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('specificIndustry')">
                <jnpf-form-tip-item label="细分行业" v-if="judgeShow('specificIndustry')" prop="specificIndustry">
                  <JnpfInput v-model="dataForm.specificIndustry" @change="changeData('specificIndustry', -1)"
                             placeholder="请输入" :disabled="judgeWrite('specificIndustry')" readonly clearable
                             :style='{ "width": "100%" }'>
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="24" v-if="judgeShow('county')">
                <jnpf-form-tip-item label="区县" v-if="judgeShow('county')" prop="county">
                  <JnpfInput v-model="dataForm.county" @change="changeData('county', -1)" placeholder="请输入"
                             :disabled="judgeWrite('county')" readonly clearable :style='{ "width": "49%" }'>
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('digitalLelfassessmentLevel')">
                <jnpf-form-tip-item label="数字化自测评等级" v-if="judgeShow('digitalLelfassessmentLevel')" label-width="145px"
                                    prop="digitalLelfassessmentLevel">
                  <JnpfInput v-model="dataForm.digitalLelfassessmentLevel"
                             @change="changeData('digitalLelfassessmentLevel', -1)" placeholder="请输入"
                             :disabled="judgeWrite('digitalLelfassessmentLevel')" clearable readonly
                             :style='{ "width": "100%" }'>
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('digitalScore')">
                <jnpf-form-tip-item label="评测分数" v-if="judgeShow('digitalScore')" prop="digitalScore">
                  <JnpfInputNumber v-model="dataForm.digitalScore" @change="changeData('digitalScore', -1)"
                                   placeholder="--" :disabled="judgeWrite('digitalScore')" clearable
                                   :style='{ "width": "100%" }'
                                   :step="1" :min="0" controls-position="right" :precision="2">
                  </JnpfInputNumber>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('aftertransformationDigitalLevel')">
                <jnpf-form-tip-item label="实施改造后预期数字化水平等级" v-if="judgeShow('aftertransformationDigitalLevel')"
                                    label-width="230px" prop="aftertransformationDigitalLevel">
                  <JnpfRadio v-model="dataForm.aftertransformationDigitalLevel"
                             @change="changeData('aftertransformationDigitalLevel', -1)"
                             :disabled="judgeWrite('aftertransformationDigitalLevel')" optionType="default"
                             direction="horizontal" size="small" :options="aftertransformationDigitalLevelOptions"
                             :props="aftertransformationDigitalLevelProps">
                  </JnpfRadio>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('aftertransformationScore')">
                <jnpf-form-tip-item label="预评测分数" v-if="judgeShow('aftertransformationScore')"
                                    prop="aftertransformationScore">
                  <JnpfInputNumber v-model="dataForm.aftertransformationScore" :precision="2"
                                   @change="changeData('aftertransformationScore', -1)" placeholder="请输入"
                                   :disabled="judgeWrite('aftertransformationScore')" :step="1" :min="0"
                                   controls-position="right"
                                   :style='{ "width": "100%" }'>
                  </JnpfInputNumber>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="24" v-if="judgeShow('individualNeeds')">
                <jnpf-form-tip-item label="个性需求" v-if="judgeShow('individualNeeds')" label-width="70px"
                                    prop="individualNeeds">
                  <JnpfEditor v-model="dataForm.individualNeeds" @change="changeData('individualNeeds', -1)"
                              placeholder="请输入" :disabled="judgeWrite('individualNeeds')" :style='{ "width": "100%" }'>
                  </JnpfEditor>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('serverName')">
                <jnpf-form-tip-item label="服务商名称" v-if="judgeShow('serverName')" prop="serverName">
                  <JnpfInput v-model="dataForm.serverName" @change="changeData('serverName', -1)" placeholder="请输入"
                             :disabled="judgeWrite('serverName')" clearable :style='{ "width": "100%" }'>
                  </JnpfInput>
                  <div class="el-upload__tip isLoan">（如有多家服务商，请以分号“;”分隔）</div>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('serverCreditCode')">
                <jnpf-form-tip-item label="服务商统一社会信用代码" v-if="judgeShow('serverCreditCode')" label-width="185px"
                                    prop="serverCreditCode">
                  <JnpfInput v-model="dataForm.serverCreditCode" @change="changeData('serverCreditCode', -1)"
                             placeholder="请输入" :disabled="judgeWrite('serverCreditCode')" clearable
                             :style='{ "width": "100%" }'>
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('projectType')">
                <jnpf-form-tip-item label="项目类别" v-if="judgeShow('projectType')" prop="projectType">
                  <JnpfInput v-model="dataForm.projectType" @change="changeData('projectType', -1)" placeholder="请输入"
                             :disabled="judgeWrite('projectType')" readonly clearable :style='{ "width": "100%" }'>
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('budgetType')">
                <jnpf-form-tip-item label="预算类别" v-if="judgeShow('budgetType')" prop="budgetType">
                  <JnpfInput v-model="dataForm.budgetType" @change="changeData('budgetType', -1)" placeholder="请输入"
                             :disabled="judgeWrite('budgetType')" readonly clearable :style='{ "width": "100%" }'>
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="24" v-if="judgeShow('projectContent')">
                <jnpf-form-tip-item label="项目内容" v-if="judgeShow('projectContent')" prop="projectContent">
                  <JnpfTextarea v-model="dataForm.projectContent" @change="changeData('projectContent', -1)"
                                placeholder="请输入" :disabled="judgeWrite('projectContent')" :style='{ "width": "100%" }'
                                true
                                type="textarea" :autosize='{ "minRows": 4, "maxRows": 4 }'>
                  </JnpfTextarea>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="24" v-if="judgeShow('digitalCurrentState')">
                <jnpf-form-tip-item label="数字化现状" tipLabel="（简述企业在“数字化基础、数字化经营、数字化管理、数字化成效”方面现在的情况）"
                                    v-if="judgeShow('digitalCurrentState')" prop="digitalCurrentState">
                  <JnpfEditor v-model="dataForm.digitalCurrentState" @change="changeData('digitalCurrentState', -1)"
                              placeholder="（简述企业在“数字化基础、数字化经营、数字化管理、数字化成效”方面现在的情况）"
                              :disabled="judgeWrite('digitalCurrentState')"
                              :style='{ "width": "100%" }'>
                  </JnpfEditor>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="24" v-if="judgeShow('expectedResults')">
                <jnpf-form-tip-item label="预期成效" v-if="judgeShow('expectedResults')" prop="expectedResults">
                  <JnpfEditor v-model="dataForm.expectedResults" @change="changeData('expectedResults', -1)"
                              placeholder="（围绕提质、增效、降本、减存、绿色、安全等方面对改造预期成效做描述）" :disabled="judgeWrite('expectedResults')"
                              :style='{ "width": "100%" }'>
                  </JnpfEditor>
                </jnpf-form-tip-item>
              </el-col>

              <el-col :span="12" v-if="judgeShow('startDate')">
                <jnpf-form-tip-item label="开始日期" v-if="judgeShow('startDate')" prop="startDate">
                  <JnpfDatePicker v-model="dataForm.startDate" @change="changeData('startDate', -1)"
                                  :startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
                                  placeholder="请选择" :disabled="judgeWrite('startDate')" clearable
                                  :style='{ "width": "100%" }'
                                  type="date" format="yyyy-MM-dd">
                  </JnpfDatePicker>
                </jnpf-form-tip-item>
              </el-col>

              <el-col :span="12" v-if="judgeShow('endDate')">
                <jnpf-form-tip-item label="结束日期" v-if="judgeShow('endDate')" prop="endDate">
                  <JnpfDatePicker v-model="dataForm.endDate" @change="changeData('endDate', -1)"
                                  :startTime="dateTime(true, 2, 1, '', dataForm.startDate)"
                                  :endTime="dateTime(false, 1, 1, '', '')"
                                  placeholder="请选择" :disabled="judgeWrite('endDate')" clearable
                                  :style='{ "width": "100%" }'
                                  type="date" format="yyyy-MM-dd">
                  </JnpfDatePicker>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="24" v-if="judgeShow('-${html.relationField}')">
                <jnpf-form-tip-item label-width="0">
                  <div class="JNPF-common-title">
                    <h2>数字化改造产品或服务预算</h2>
                  </div>
                  <el-table :data="dataForm.fz_project_digital_budgetList" size='mini' show-summary
                            :summary-method="getfz_project_digital_budgetSummaries">
                    <el-table-column type="index" width="50" label="序号" align="center"/>
                    <el-table-column label="预算名称" v-if="judgeShow('fz_project_digital_budget-budgetName')"
                                     prop="budgetName">
                      <template slot="header">
                        <span class="required-sign"
                              v-if="judgeRequired('fz_project_digital_budgetList-budgetName')">*</span>预算名称
                      </template>
                      <template slot-scope="scope">
                        <JnpfInput v-model="scope.row.budgetName"
                                   @change="changeData('fz_project_digital_budget-budgetName', scope.$index)"
                                   placeholder="请输入"
                                   :disabled="!(judgeWrite('fz_project_digital_budgetList') && judgeWrite('fz_project_digital_budgetList-budgetName')) && (judgeWrite('fz_project_digital_budgetList') || judgeWrite('fz_project_digital_budgetList-budgetName'))"
                                   clearable :style='{ "width": "100%" }' readonly>
                        </JnpfInput>
                      </template>
                    </el-table-column>
                    <el-table-column label="预算金额(万元)" v-if="judgeShow('fz_project_digital_budget-budgetMoney')"
                                     prop="budgetMoney">
                      <template slot="header">
                        <span class="required-sign"
                              v-if="judgeRequired('fz_project_digital_budgetList-budgetMoney')">*</span>预算金额(万元)
                      </template>
                      <template slot-scope="scope">
                        <JnpfInputNumber v-model="scope.row.budgetMoney" :precision="2"
                                         @change="changeData('fz_project_digital_budget-budgetMoney', scope.$index)"
                                         placeholder="数值输入"
                                         :disabled="(judgeWrite('fz_project_digital_budgetList') && judgeWrite('fz_project_digital_budget-budgetMoney'))"
                                         addonAfter="万元" :step="1" :controls="false">
                        </JnpfInputNumber>
                      </template>
                    </el-table-column>
                    <!--                    <el-table-column label="操作" width="50" v-if="!judgeWrite('fz_project_digital_budgetList')">
                                          <template slot-scope="scope">
                                            <el-button size="mini" type="text" class="JNPF-table-delBtn"
                                                       @click="delfz_project_digital_budgetList(scope.$index)">删除
                                            </el-button>
                                          </template>
                                        </el-table-column>-->
                  </el-table>
                  <!--                  <div class="table-actions" @click="addfz_project_digital_budgetList()"
                                         v-if="!judgeWrite('fz_project_digital_budgetList')">
                                      <el-button type="text" icon="el-icon-plus">添加</el-button>
                                    </div>-->
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="24" v-if="judgeShow('fz_project_digital_budget-${html.relationField}')">
                <jnpf-form-tip-item label-width="0">
                  <div class="JNPF-common-title">
                    <h2>其他支出预算</h2>
                  </div>
                  <el-table :data="dataForm.fz_project_other_digital_budgetList" size='mini' show-summary
                            :summary-method="getfz_project_other_digital_budgetSummaries">
                    <el-table-column type="index" width="50" label="序号" align="center"/>
                    <el-table-column label="预算名称（除了以上1-4项外的支出项，按实际增加行数）"
                                     v-if="judgeShow('fz_project_other_digital_budget-budgetName')" prop="budgetName">
                      <template slot="header">
                        <span class="required-sign"
                              v-if="judgeRequired('fz_project_other_digital_budgetList-budgetName')">*</span>预算名称（除了以上1-4项外的支出项，按实际增加行数）
                      </template>
                      <template slot-scope="scope">
                        <JnpfInput v-model="scope.row.budgetName"
                                   @change="changeData('fz_project_other_digital_budget-budgetName', scope.$index)"
                                   placeholder="请输入"
                                   :disabled="!(judgeWrite('fz_project_other_digital_budgetList') && judgeWrite('fz_project_other_digital_budgetList-budgetName')) && (judgeWrite('fz_project_other_digital_budgetList') || judgeWrite('fz_project_other_digital_budgetList-budgetName'))"
                                   clearable :style='{ "width": "100%" }'>
                        </JnpfInput>
                      </template>
                    </el-table-column>
                    <el-table-column label="预算金额(万元)" v-if="judgeShow('fz_project_other_digital_budget-budgetMoney')"
                                     prop="budgetMoney">
                      <template slot="header">
                        <span class="required-sign"
                              v-if="judgeRequired('fz_project_other_digital_budgetList-budgetMoney')">*</span>预算金额(万元)
                      </template>
                      <template slot-scope="scope">
                        <JnpfInputNumber v-model="scope.row.budgetMoney"
                                         @change="changeData('fz_project_other_digital_budget-budgetMoney', scope.$index)"
                                         placeholder="数值输入" :precision="2"
                                         :disabled="!(judgeWrite('fz_project_other_digital_budgetList') && judgeWrite('fz_project_other_digital_budgetList-budgetMoney')) && (judgeWrite('fz_project_other_digital_budgetList') || judgeWrite('fz_project_other_digital_budgetList-budgetMoney'))"
                                         addonAfter="万元" :step="1" :controls="false">
                        </JnpfInputNumber>
                      </template>
                    </el-table-column>
                    <el-table-column label="操作" width="50">
                      <template slot-scope="scope">
                        <el-button size="mini" type="text" class="JNPF-table-delBtn"
                                   @click="delfz_project_other_digital_budgetList(scope.$index)">删除
                        </el-button>
                      </template>
                    </el-table-column>
                  </el-table>
                  <div class="table-actions" @click="addfz_project_other_digital_budgetList()">
                    <el-button type="text" icon="el-icon-plus">添加</el-button>
                  </div>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('digitalBudgetTotal')">
                <jnpf-form-tip-item label="数字化改造产品或服务预算合计(万元)" v-if="judgeShow('digitalBudgetTotal')"
                                    label-width="270px" prop="digitalBudgetTotal">
                  <JnpfInput v-model="dataForm.digitalBudgetTotal" @change="changeData('digitalBudgetTotal', -1)"
                             placeholder="请输入" :disabled="judgeWrite('digitalBudgetTotal')" clearable readonly
                             :style='{ "width": "100%" }' addonAfter="万元">
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('otherDigitalTotal')">
                <jnpf-form-tip-item label="其他支出项预算合计(万元)" v-if="judgeShow('otherDigitalTotal')" label-width="200px"
                                    prop="otherDigitalTotal">
                  <JnpfInput v-model="dataForm.otherDigitalTotal" @change="changeData('otherDigitalTotal', -1)"
                             placeholder="请输入" :disabled="judgeWrite('otherDigitalTotal')" clearable readonly
                             :style='{ "width": "100%" }' addonAfter="万元">
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('generalBudget')">
                <jnpf-form-tip-item label="总预算（万元）" v-if="judgeShow('generalBudget')" label-width="130px"
                                    prop="generalBudget">
                  <JnpfInput v-model="dataForm.generalBudget" @change="changeData('generalBudget', -1)"
                             placeholder="请输入" :disabled="judgeWrite('generalBudget')" clearable readonly
                             :style='{ "width": "100%" }' addonAfter="万元">
                  </JnpfInput>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('digitalRenovationFunds')">
                <jnpf-form-tip-item label="拟支持数字化改造资金（万元）" tipLabel="（《关于推进工业数字化转型八条措施》第一部分“支持中小企业数字化转型城市试点”中的第一点进行测算）"
                                    v-if="judgeShow('digitalRenovationFunds')" label-width="230px"
                                    prop="digitalRenovationFunds">
                  <JnpfInputNumber v-model="dataForm.digitalRenovationFunds"
                                   tipText="（《关于推进工业数字化转型八条措施》第一部分“支持中小企业数字化转型城市试点”中的第一点进行测算）"
                                   @change="changeData('digitalRenovationFunds', -1)" placeholder="数值输入"
                                   :disabled="judgeWrite('digitalRenovationFunds')" addonAfter="万元" :precision="2"
                                   :step="1" :controls="false">
                  </JnpfInputNumber>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('isLoan')">
                <jnpf-form-tip-item tipLabel="贷款需求可见范围请前往[企业及服务商库]-[金融服务需求]设置 附链接" label="是否有贷款需求"
                                    v-if="judgeShow('isLoan')" label-width="130px" prop="isLoan">
                  <JnpfRadio v-model="dataForm.isLoan" @change="changeData('isLoan', -1)"
                             :disabled="judgeWrite('isLoan')" optionType="default" direction="horizontal" size="small"
                             :options="isLoanOptions" :props="isLoanProps">
                  </JnpfRadio>
                  <div class="el-upload__tip isLoan2"><a href="http://test-fzzxqy.demo-caii.com/model/jrfwxq"
                                                         target="_blank">贷款需求可见范围请前往[企业及服务商库]-[金融服务需求]设置</a></div>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="12" v-if="judgeShow('loanMoney') && this.dataForm.isLoan === '1'">
                <jnpf-form-tip-item label="意向贷款金额(万元)" v-if="judgeShow('loanMoney')" label-width="155px"
                                    prop="loanMoney">
                  <JnpfInputNumber v-model="dataForm.loanMoney" @change="changeData('loanMoney', -1)" placeholder="数字输入"
                                   :disabled="judgeWrite('loanMoney')" :step="1" :precision="2" :controls="false"
                                   addonAfter="万元">
                  </JnpfInputNumber>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="24" v-if="judgeShow('authenticityCommitment')">
                <jnpf-form-tip-item label="真实性承诺" v-if="judgeShow('authenticityCommitment')"
                                    prop="authenticityCommitment">
                  <JnpfEditor v-model="dataForm.authenticityCommitment"
                              @change="changeData('authenticityCommitment', -1)" placeholder="请输入"
                              :disabled="judgeWrite('authenticityCommitment')" :style='{ "width": "100%" }'>
                  </JnpfEditor>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="24" v-if="judgeShow('digitalBudgetFiles')">
                <jnpf-form-tip-item label="数字化改造产品或服务预算明细附件" v-if="judgeShow('digitalBudgetFiles')" label-width="120px"
                                    prop="digitalBudgetFiles">
                  <JnpfUploadFile v-model="dataForm.digitalBudgetFiles" @change="changeData('digitalBudgetFiles', -1)"
                                  :disabled="judgeWrite('digitalBudgetFiles')" :fileSize="50" sizeUnit="MB" :limit="9"
                                  pathType="defaultPath" :isAccount="0" buttonText="点击上传">
                  </JnpfUploadFile>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="24" v-if="judgeShow('otherBudgetFiles')">
                <jnpf-form-tip-item label="其他支出项预算明细附件" label-width="120px" prop="otherBudgetFiles">
                  <JnpfUploadFile v-model="dataForm.otherBudgetFiles" @change="changeData('otherBudgetFiles', -1)"
                                  :fileSize="50" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0"
                                  buttonText="点击上传">
                  </JnpfUploadFile>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="24" v-if="judgeShow('digitalServiceContractFiles')">
                <jnpf-form-tip-item label="数字化改造项目服务合同" v-if="judgeShow('digitalServiceContractFiles')"
                                    label-width="195px" prop="digitalServiceContractFiles">
                  <JnpfUploadFile v-model="dataForm.digitalServiceContractFiles"
                                  @change="changeData('digitalServiceContractFiles', -1)"
                                  :disabled="judgeWrite('digitalServiceContractFiles')" :fileSize="50" sizeUnit="MB"
                                  :limit="9"
                                  pathType="defaultPath" :isAccount="0" buttonText="点击上传">
                  </JnpfUploadFile>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="24" v-if="judgeShow('digitalProjectPlanFiles')">
                <jnpf-form-tip-item label="数字化改造项目方案" v-if="judgeShow('digitalProjectPlanFiles')" label-width="165px"
                                    prop="digitalProjectPlanFiles">
                  <JnpfUploadFile v-model="dataForm.digitalProjectPlanFiles"
                                  @change="changeData('digitalProjectPlanFiles', -1)"
                                  :disabled="judgeWrite('digitalProjectPlanFiles')" :fileSize="50" sizeUnit="MB"
                                  :limit="9"
                                  pathType="defaultPath" :isAccount="0" buttonText="点击上传">
                  </JnpfUploadFile>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="20" v-if="judgeShow('recordFormFiles')" class="project-table">
                <jnpf-form-tip-item label="福州市中小企业数字化转型试点被改造企业项目表" v-if="judgeShow('recordFormFiles')"
                                    label-width="150px" prop="recordFormFiles">
                  <JnpfUploadFile v-model="dataForm.recordFormFiles" @change="changeData('recordFormFiles', -1)"
                                  tipText="(请被改造企业导出项目表并打印纸质版，在封面和真实性承诺相关位置处盖章，将盖章版项目表扫描成电子档上传平台，请上传pdf)"
                                  :disabled="judgeWrite('recordFormFiles')" :fileSize="50" sizeUnit="MB" :limit="9"
                                  pathType="defaultPath" :isAccount="0" buttonText="点击上传" accept=".pdf,.doc,.docx">
                  </JnpfUploadFile>
                </jnpf-form-tip-item>
              </el-col>
              <el-col :span="4">
                <jnpf-form-tip-item label=" ">
                  <el-button type="danger" round icon="icon-ym icon-ym-report-icon-preview-printPreview"
                             @click="printDialog()">打 印
                  </el-button>
                </jnpf-form-tip-item>

              </el-col>
              <!--              <el-col :span="24" v-if="judgeShow('checkStatus')">
                              <jnpf-form-tip-item
                                label="验收状态" v-if="judgeShow('checkStatus')" prop="checkStatus">
                                <JnpfInput v-model="dataForm.checkStatus" @change="changeData('checkStatus',-1)"
                                           placeholder="请输入" :disabled="judgeWrite('checkStatus')" clearable :style='{"width":"100%"}'>
                                </JnpfInput>
                              </jnpf-form-tip-item>
                            </el-col>
                            <el-col :span="24" v-if="judgeShow('examExpert')">
                              <jnpf-form-tip-item
                                label="审核专家" v-if="judgeShow('examExpert')" prop="examExpert">
                                <JnpfInput v-model="dataForm.examExpert" @change="changeData('examExpert',-1)"
                                           placeholder="请输入" :disabled="judgeWrite('examExpert')" clearable :style='{"width":"100%"}'>
                                </JnpfInput>
                              </jnpf-form-tip-item>
                            </el-col>
                            <el-col :span="24" v-if="judgeShow('createProjectStatus')">
                              <jnpf-form-tip-item
                                label="创建项目状态" v-if="judgeShow('createProjectStatus')" label-width="120px" prop="createProjectStatus">
                                <JnpfInput v-model="dataForm.createProjectStatus" @change="changeData('createProjectStatus',-1)"
                                           placeholder="请输入" :disabled="judgeWrite('createProjectStatus')" clearable
                                           :style='{"width":"100%"}'>
                                </JnpfInput>
                              </jnpf-form-tip-item>
                            </el-col>-->
            </el-row>
          </el-col>
          <el-col :span="4">
            <el-row :gutter="30">
              <el-col :span="24">
                <jnpf-form-tip-item>
                  <JnpfText
                    :textStyle='{ "color": "#000000", "font-weight": "normal", "text-decoration": "none", "font-size": 12, "line-height": 32, "font-style": "normal", "text-align": "left" }'>
                  </JnpfText>
                </jnpf-form-tip-item>
              </el-col>
            </el-row>
          </el-col>
          <!-- 表单结束 -->
        </template>
        <print-browse :visible.sync="printBrowseVisible" :id="printIdNow" :batchIds="multipleSelection.join()"/>
        <PrintDialog v-if="printDialogVisible" ref="printDialog" @change="printBrowseHandle"/>
        <ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false"/>
        <SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
                      @select="addForSelect" @close="selectDialogVisible = false"/>
      </el-form>
    </el-row>
    <UserBox v-if="userBoxVisible" ref="userBox" @submit="submit"/>
  </div>
</template>

<script>
import request from '@/utils/request'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {mapGetters} from "vuex";
import {getFormById} from '@/api/workFlow/FormDesign'
import comMixin from '@/views/workFlow/workFlowForm/mixin';
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
import {getDefaultCurrentValueUserId} from '@/api/permission/user'
import {getDefaultCurrentValueDepartmentId} from '@/api/permission/organize'
import {
  getDateDay,
  getLaterData,
  getBeforeData,
  getBeforeTime,
  getLaterTime
} from '@/components/Generator/utils/index.js'
import {thousandsFormat} from "@/components/Generator/utils/index"
import axios from "axios";
import PrintDialog from "@/components/PrintDialog";
import PrintBrowse from "@/components/PrintBrowse/batch";

export default {
  mixins: [comMixin],
  components: {PrintDialog, PrintBrowse, ToFormDetail},
  props: [],
  data() {
    return {
      id: undefined,
      toFormDetailVisible: false,
      printDialogVisible: false,
      printBrowseVisible: false,
      printId: '530664214025472453',
      printIdNow: '530664214025472453',
      multipleSelection: [],
      dataFormSubmitType: 0,
      continueBtnLoading: false,
      index: 0,
      prevDis: false,
      nextDis: false,
      allList: [],
      visible: false,
      loading: false,
      btnLoading: false,
      formRef: 'formRef',
      setting: {},
      eventType: '',
      userBoxVisible: false,
      selectDialogVisible: false,
      currTableConf: {},
      dataValueAll: {},
      addTableConf: {
        fz_project_digital_budgetList: {
          "popupType": "dialog",
          "hasPage": true,
          "popupTitle": "选择数据",
          "pageSize": 20,
          "columnOptions": [],
          "interfaceId": "",
          "interfaceName": "",
          "relationOptions": [],
          "templateJson": [],
          "popupWidth": "800px"
        },
        fz_project_other_digital_budgetList: {
          "popupType": "dialog",
          "hasPage": true,
          "popupTitle": "选择数据",
          "pageSize": 20,
          "columnOptions": [],
          "interfaceId": "",
          "interfaceName": "",
          "relationOptions": [],
          "templateJson": [],
          "popupWidth": "800px"
        },
      },
      //可选范围默认值
      ableAll: {},
      tableRows: {
        fz_project_digital_budgetList: {
          budgetName: '',
          budgetNameOptions: [],
          budgetMoney: undefined,
          budgetMoneyOptions: [],
          enabledmark: undefined
        },
        fz_project_other_digital_budgetList: {
          budgetName: '',
          budgetNameOptions: [],
          budgetMoney: undefined,
          budgetMoneyOptions: [],
          enabledmark: undefined
        },
      },
      Vmodel: "",
      currVmodel: "",
      dataForm: {
        projectName: undefined,
        projectLeader: undefined,
        phone: undefined,
        enterpriseName: undefined,
        enterpriseCreditCode: undefined,
        enterpriseIntroduce: undefined,
        county: undefined,
        industry: undefined,
        specificIndustry: undefined,
        digitalLelfassessmentLevel: undefined,
        digitalScore: undefined,
        aftertransformationDigitalLevel: undefined,
        aftertransformationScore: undefined,
        individualNeeds: undefined,
        serverName: undefined,
        serverCreditCode: undefined,
        projectType: "数字化改造",
        budgetType: "数字化改造",
        projectContent: undefined,
        digitalCurrentState: undefined,
        expectedResults: undefined,
        startDate: undefined,
        endDate: undefined,
        digitalBudgetTotal: 0,
        otherDigitalTotal: 0,
        generalBudget: 0,
        digitalRenovationFunds: undefined,
        isLoan: undefined,
        loanMoney: undefined,
        digitalBudgetFiles: [{
          "fileSize": 17983,
          "fileExtension": "docx",
          "name": "数字化改造产品或服务预算明细.docx",
          "url": "/api/file/Image/annex/65ed80d760b2fa4944e07983.docx",
          "fileId": "65ed80d760b2fa4944e07983.docx"
        }],
        otherBudgetFiles: [{
          "fileSize": 17752,
          "fileExtension": "docx",
          "name": "其他支出项预算明细.docx",
          "url": "/api/file/Image/annex/65ed80df60b2fa4944e07984.docx",
          "fileId": "65ed80df60b2fa4944e07984.docx"
        }],
        digitalServiceContractFiles: [{
          "fileSize": 97776,
          "fileExtension": "doc",
          "name": "中小企业数字化改造项目服务合同.doc",
          "url": "/api/file/Image/annex/65d7fc3260b24a5f691bd2f0.doc",
          "fileId": "65d7fc3260b24a5f691bd2f0.doc"
        }],
        digitalProjectPlanFiles: [{
          "fileSize": 33052,
          "fileExtension": "docx",
          "name": "项目方案.docx",
          "url": "/api/file/Image/annex/65d7fc3760b24a5f691bd2f1.docx",
          "fileId": "65d7fc3760b24a5f691bd2f1.docx"
        }],
        recordFormFiles: [],
        authenticityCommitment: "<p>&nbsp; &nbsp; &nbsp; &nbsp;本单位保证所填内容和提交资料准确、真实、合法、有效，如有不实之处，愿负相应的责任，并承担因此造成的一切后果。</p><p><br></p><p><br></p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;公司盖章:</p>" +
          "<br></p><p><br><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;年&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;月&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;日</p>",
        checkStatus: "0",
        examStatus: undefined,
        examExpert: undefined,
        creatoruserid: undefined,
        creatortime: undefined,
        lastmodifyuserid: undefined,
        lastmodifytime: undefined,
        createProjectStatus: undefined,
        fz_project_digital_budgetList: [],
        fz_project_other_digital_budgetList: [],
      },
      tableRequiredData: {},
      dataRule:
        {
          enterpriseName: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          enterpriseCreditCode: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          enterpriseIntroduce: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          projectName: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          projectLeader: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          phone: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
            {
              pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
              message: '请输入正确的联系方式',
              trigger: 'blur'
            },
          ],
          industry: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          specificIndustry: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          county: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          digitalLelfassessmentLevel: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          aftertransformationDigitalLevel: [
            {
              required: true,
              message: '不能为空',
              trigger: 'change'
            },
          ],
          aftertransformationScore: [
            {
              required: true,
              message: '请输入',
              trigger: ["blur", "change"]
            },
          ],
          individualNeeds: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          serverName: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          serverCreditCode: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          projectType: [
            {
              required: true,
              message: '请至少选择一个',
              trigger: 'blur'
            },
          ],
          budgetType: [
            {
              required: true,
              message: '请至少选择一个',
              trigger: 'blur'
            },
          ],
          projectContent: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          digitalCurrentState: [
            {
              required: true,
              message: '请至少选择一个',
              trigger: 'blur'
            },
          ],
          expectedResults: [
            {
              required: true,
              message: '请至少选择一个',
              trigger: 'blur'
            },
          ],
          startDate: [
            {
              required: true,
              message: '请选择',
              trigger: 'change'
            },
          ],
          endDate: [
            {
              required: true,
              message: '请选择',
              trigger: 'change'
            },
          ],
          digitalBudgetTotal: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          otherDigitalTotal: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          generalBudget: [
            {
              required: true,
              message: '请输入',
              trigger: 'blur'
            },
          ],
          digitalRenovationFunds: [
            {
              required: true,
              message: '请输入',
              trigger: ["blur", "change"]
            },
          ],
          isLoan: [
            {
              required: true,
              message: '不能为空',
              trigger: 'change'
            },
          ],
          authenticityCommitment: [
            {
              required: true,
              message: '请至少选择一个',
              trigger: 'blur'
            },
          ],
          digitalBudgetFiles: [
            {
              required: true,
              message: '请至少选择一个',
              trigger: 'change'
            },
          ],
          otherBudgetFiles: [
            {
              required: true,
              message: '请至少选择一个',
              trigger: 'change'
            },
          ],
          digitalServiceContractFiles: [
            {
              required: true,
              message: '请至少选择一个',
              trigger: 'change'
            },
          ],
          digitalProjectPlanFiles: [
            {
              required: true,
              message: '请至少选择一个',
              trigger: 'change'
            },
          ],
        },
      aftertransformationDigitalLevelOptions: [{"fullName": "无等级", "id": "0"}, {
        "fullName": "一级",
        "id": "1"
      }, {"fullName": "二级", "id": "2"}, {"fullName": "三级", "id": "3"}, {"fullName": "四级", "id": "4"}],
      aftertransformationDigitalLevelProps: {"label": "fullName", "value": "id"},
      isLoanOptions: [{"fullName": "是", "id": "1"}, {"fullName": "否", "id": "0"}],
      isLoanProps: {"label": "fullName", "value": "id"},
      childIndex: -1,
      isEdit: false,
      interfaceRes: {
        projectName: [],
        projectLeader: [],
        phone: [],
        enterpriseName: [],
        enterpriseCreditCode: [],
        enterpriseIntroduce: [],
        county: [],
        industry: [],
        specificIndustry: [],
        digitalLelfassessmentLevel: [],
        digitalScore: [],
        aftertransformationDigitalLevel: [],
        aftertransformationScore: [],
        individualNeeds: [],
        serverName: [],
        serverCreditCode: [],
        projectType: [],
        budgetType: [],
        projectContent: [],
        digitalCurrentState: [],
        expectedResults: [],
        startDate: [],
        endDate: [],
        digitalBudgetTotal: [],
        otherDigitalTotal: [],
        generalBudget: [],
        digitalRenovationFunds: [],
        isLoan: [],
        loanMoney: [],
        digitalBudgetFiles: [],
        otherBudgetFiles: [],
        digitalServiceContractFiles: [],
        digitalProjectPlanFiles: [],
        recordFormFiles: [],
        authenticityCommitment: [],
        checkStatus: [],
        examExpert: [],
        creatoruserid: [],
        creatortime: [],
        lastmodifyuserid: [],
        lastmodifytime: [],
        createProjectStatus: [],
        fz_project_digital_budgetbudgetName: [],
        fz_project_digital_budgetbudgetMoney: [],
        fz_project_other_digital_budgetbudgetName: [],
        fz_project_other_digital_budgetbudgetMoney: [],
      },
    }
  },
  computed: {
    ...mapGetters(['userInfo']),
    formOperates() {
      // this.setting.id = this.id;
      this.multipleSelection = [this.setting.id];
      return this.setting.formOperates
    }
  },
  watch: {},
  created() {
    this.selectUserInfo();
    this.selectDigitalLelfAssessmentLevel();
    this.addFz_project_digital_budgetList();
    this.getFormById()
    if (this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id == 0) {
      this.initDefaultData()
    }
    this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
  },
  mounted() {
  },
  methods: {
    getLoanInfo(Enterprise_credit_code) {
      //加载贷款需求贷款金额信息
      const query = {
        "paramList": [
          {
            "id": "gOgGy22",
            "field": "Enterprise_credit_code",
            "defaultValue": Enterprise_credit_code,
            "fieldName": "",
            "dataType": "varchar",
            "required": 0
          }
        ],
        "tenantId": "", "origin": "preview"
      }
      getDataInterfaceRes("547053090621097093", query).then(res => {
        if (JSON.stringify(res.data) != '[]') {
          var data = res.data[0]
          this.dataForm.isLoan = data.F_Is_Loan
          this.dataForm.loanMoney = data.F_Loan_Money
        }
      });
    },
    sumbitButtonIsShow() {
      // 找到所有class为"el-button"的按钮
      const buttons = document.querySelectorAll('.el-button');
      // 遍历按钮列表
      buttons.forEach(button => {
        // 检查按钮的文本内容是否包含"提 交"两个字
        if (button.textContent.includes('提 交')) {
          // 打印符合条件的按钮
          // 根据data的长度直接设置按钮的显示状态
          if (this.dataForm.recordFormFiles === undefined || this.dataForm.recordFormFiles.length === 0) {
            button.style.display = 'none'; // 隐藏按钮
          } else {
            button.style.display = ''; // 显示按钮
          }
        }
      });
    },
    printDialog() {
      this.printDialogVisible = true;
      this.$nextTick(() => {
        if (this.printId.length == 1) {
          this.printBrowseHandle(this.printId[0].id);
          return;
        }
        this.$refs.printDialog.init(this.printId.split(","));
      });
    },
    printBrowseHandle(id) {
      this.printDialogVisible = false;
      this.handleBatchPrint(id);
    },
    handleBatchPrint(id) {
      if (!id) {
        this.$message({
          type: "warning",
          message: "请配置打印模板",
          duration: 1500
        });
        return;
      }
      this.printIdNow = id;
      this.printBrowseVisible = true;
    },
    addFz_project_digital_budgetList() {
      // 添加多条数据到 fz_project_digital_budgetList 数组中
      this.dataForm.fz_project_digital_budgetList.push(
        {budgetName: "数字化改造相关的软件", budgetMoney: 0.00},
        {budgetName: "云服务支出", budgetMoney: 0.00},
        {budgetName: "网关、路由等必要的数据采集传输设备支出", budgetMoney: 0.00},
        {budgetName: "咨询诊断费用", budgetMoney: 0.00}
      );
    },
    selectDigitalLelfAssessmentLevel() {
      const userId = this.userInfo.userAccount;
      const url = `http://test-fzzxqy.demo-caii.com/cloud-api2/fzzxqy/digital_lelfAssessment_level?userId=${userId}`;
      axios.get(url).then(res => {
        if (res.data.data.length === 0) {
          this.dataForm.digitalLelfassessmentLevel = '暂未查询到您的评测结果';
          // this.dataForm.digitalScore = undefined;
        } else {
          const digitalLevelInfo = res.data.data[0]
          this.dataForm.digitalLelfassessmentLevel = digitalLevelInfo.F_LevelName;
          this.dataForm.digitalScore = this.dataForm.digitalScore === null || this.dataForm.digitalScore === undefined ? digitalLevelInfo.F_Score : this.dataForm.digitalScore;
        }
      })
    },
    selectUserInfo() {
      const userId = this.userInfo.userAccount;
      const url = `http://test-fzzxqy.demo-caii.com/cloud-api2/fzzxqy/company_base_main?userId=${userId}`;
      axios.get(url).then(res => {
        const companyInfo = res.data.data[0]
        this.dataForm.enterpriseName = companyInfo.Enterprise_name;
        this.dataForm.enterpriseCreditCode = companyInfo.Enterprise_credit_code;
        this.dataForm.county = companyInfo.Owning_region;
        this.dataForm.industry = companyInfo.industry;
        this.dataForm.specificIndustry = companyInfo.Specific_industry;
        this.getLoanInfo(companyInfo.Enterprise_credit_code)
      })
    },
    changeData(model, index) {
      if (model === "recordFormFiles") {
        this.sumbitButtonIsShow()
      }
      if (model === "fz_project_digital_budget-budgetMoney" || model === "fz_project_other_digital_budget-budgetMoney") {
        let sum1 = 0;
        let sum2 = 0;
        this.dataForm.fz_project_digital_budgetList.map((value) => {
          sum1 += value.budgetMoney //公式计算
        })
        this.dataForm.fz_project_other_digital_budgetList.map((value) => {
          sum2 += value.budgetMoney //公式计算
        })
        this.dataForm.generalBudget = (sum1 + sum2).toFixed(2)
      }
      this.isEdit = false
      this.childIndex = index
      let modelAll = model.split("-");
      let faceMode = "";
      for (let i = 0; i < modelAll.length; i++) {
        faceMode += modelAll[i];
      }
      for (let key in this.interfaceRes) {
        if (key != faceMode) {
          let faceReList = this.interfaceRes[key]
          for (let i = 0; i < faceReList.length; i++) {
            if (faceReList[i].relationField == model) {
              let options = 'get' + key + 'Options';
              if (this[options]) {
                this[options]()
              }
              this.changeData(key, index)
            }
          }
        }
      }
    },
    changeDataFormData(type, data, model, index, defaultValue) {
      if (!this.isEdit) {
        if (type == 2) {
          for (let i = 0; i < this.dataForm[data].length; i++) {
            if (index == -1) {
              this.dataForm[data][i][model] = defaultValue
            } else if (index == i) {
              this.dataForm[data][i][model] = defaultValue
            }
          }
        } else {
          this.dataForm[data] = defaultValue
        }
      }
    },
    dataAll() {
    },
    selfGetInfo(dataForm) {
      this.dataInfo(dataForm)
    },
    beforeSubmit() {
      //是否修改创建项目状态
      if (this.eventType === "save") {
        this.dataForm.createProjectStatus = '项目备案'
      } else {
        this.dataForm.createProjectStatus = '项目审核'
      }
      const _data = this.dataList()
      return _data
    },
    selfInit() {
      this.dataAll()
    },
    getFormById() {
      getFormById("530399278779075013").then(res => {
        this.dataForm.flowId = res.data && res.data.flowId
        // this.encode = res.data&&res.data.encode
        this.sumbitButtonIsShow();
      })
    },
    exist() {
      let isOk = true
      for (let key in this.tableRequiredData) {
        if (this.dataForm[key] && Array.isArray(this.dataForm[key])) {
          for (let i = 0; i < this.dataForm[key].length; i++) {
            let item = this.dataForm[key][i]
            inner: for (let id in item) {
              let arr = this.tableRequiredData[key].filter(o => o.id === id) || []
              if (!arr.length) continue inner
              if (arr[0].required) {
                let msg = `${arr[0].name}不能为空`
                let boo = true
                if (arr[0].dataType === 'array') {
                  boo = !this.jnpf.isEmptyArray(item[id])
                } else {
                  boo = !this.jnpf.isEmpty(item[id])
                }
                if (!boo) {
                  this.$message({
                    message: msg,
                    type: 'error',
                    duration: 1000
                  })
                  isOk = false
                  break
                }
              }
            }
          }
        }
      }
      if (!this.fz_project_digital_budgetExist()) return
      if (!this.fz_project_other_digital_budgetExist()) return
      return isOk
    },
    fz_project_digital_budgetExist() {
      let isOk = true;
      for (let i = 0; i < this.dataForm.fz_project_digital_budgetList.length; i++) {
        const e = this.dataForm.fz_project_digital_budgetList[i];
      }
      return isOk;
    },
    fz_project_other_digital_budgetExist() {
      let isOk = true;
      for (let i = 0; i < this.dataForm.fz_project_other_digital_budgetList.length; i++) {
        const e = this.dataForm.fz_project_other_digital_budgetList[i];
      }
      return isOk;
    },
    getfz_project_digital_budgetSummaries(param) {
      const summaryField = ["budgetMoney"];
      const {columns, data} = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          this.dataForm.digitalBudgetTotal = 0
          sums[index] = '合计';
          return;
        }
        if (!summaryField.includes(column.property)) {
          sums[index] = '';
          return;
        }
        const values = data.map(item => Number(item[column.property]));
        if (!values.every(value => isNaN(value))) {
          sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr);
            if (!isNaN(value)) {
              return prev + curr;
            } else {
              return prev;
            }
          }, 0).toFixed(2);
          this.dataForm.digitalBudgetTotal = sums[index]
          const thousandsField = [];
          if (thousandsField.includes(column.property)) {
            sums[index] = thousandsFormat(sums[index]);
          }
        } else {
          sums[index] = '';
        }
      });
      return sums;
    },
    getfz_project_other_digital_budgetSummaries(param) {
      const summaryField = ["budgetMoney"];
      const {columns, data} = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          this.dataForm.otherDigitalTotal = 0
          sums[index] = '合计';
          return;
        }
        if (!summaryField.includes(column.property)) {
          sums[index] = '';
          return;
        }
        const values = data.map(item => Number(item[column.property]));
        if (!values.every(value => isNaN(value))) {
          sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr);
            if (!isNaN(value)) {
              return prev + curr;
            } else {
              return prev;
            }
          }, 0).toFixed(2);
          this.dataForm.otherDigitalTotal = sums[index]
          const thousandsField = [];
          if (thousandsField.includes(column.property)) {
            sums[index] = thousandsFormat(sums[index]);
          }
        } else {
          sums[index] = '';
        }
      });
      return sums;
    },
    goBack() {
      this.$emit('refresh')
    },
    clearData() {
      this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
    },
    //初始化默认数据
    initDefaultData() {

    },
    addfz_project_digital_budgetList() {
      let item = {
        budgetName: undefined,
        budgetMoney: undefined,
      }
      this.getfz_project_digital_budgetList(item)
    },
    delfz_project_digital_budgetList(index) {
      this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
        type: 'warning'
      }).then(() => {
        this.dataForm.fz_project_digital_budgetList.splice(index, 1);
        let sum1 = 0;
        let sum2 = 0;
        this.dataForm.fz_project_digital_budgetList.map((value) => {
          sum1 += value.budgetMoney //公式计算
        })
        this.dataForm.fz_project_other_digital_budgetList.map((value) => {
          sum2 += value.budgetMoney //公式计算
        })
        this.dataForm.generalBudget = (sum1 + sum2).toFixed(2)
      }).catch(() => {
      });
    },
    getfz_project_digital_budgetList(value) {
      let item = {...this.tableRows.fz_project_digital_budgetList, ...value}
      this.dataForm.fz_project_digital_budgetList.push(item)
      this.childIndex = this.dataForm.fz_project_digital_budgetList.length - 1
      this.isEdit = true
      this.isEdit = false
      this.childIndex = -1
    },
    addfz_project_other_digital_budgetList() {
      let item = {
        budgetName: undefined,
        budgetMoney: undefined,
      }
      this.getfz_project_other_digital_budgetList(item)
    },
    delfz_project_other_digital_budgetList(index) {
      this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
        type: 'warning'
      }).then(() => {
        this.dataForm.fz_project_other_digital_budgetList.splice(index, 1);
        let sum1 = 0;
        let sum2 = 0;
        this.dataForm.fz_project_digital_budgetList.map((value) => {
          sum1 += value.budgetMoney //公式计算
        })
        this.dataForm.fz_project_other_digital_budgetList.map((value) => {
          sum2 += value.budgetMoney //公式计算
        })
        this.dataForm.generalBudget = (sum1 + sum2).toFixed(2)
      }).catch(() => {
      });
    },
    getfz_project_other_digital_budgetList(value) {
      let item = {...this.tableRows.fz_project_other_digital_budgetList, ...value}
      this.dataForm.fz_project_other_digital_budgetList.push(item)
      this.childIndex = this.dataForm.fz_project_other_digital_budgetList.length - 1
      this.isEdit = true
      this.isEdit = false
      this.childIndex = -1
    },
    openSelectDialog(key) {
      this.currTableConf = this.addTableConf[key]
      this.currVmodel = key
      this.selectDialogVisible = true
      this.$nextTick(() => {
        this.$refs.selectDialog.init()
      })
    },
    addForSelect(data) {
      for (let i = 0; i < data.length; i++) {
        let t = data[i]
        if (this['get' + this.currVmodel]) {
          this['get' + this.currVmodel](t)
        }
      }
    },
    dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
      let timeDataValue = null;
      let timeValue = Number(timeValueData)
      if (timeRule) {
        if (timeType == 1) {
          timeDataValue = timeValue
        } else if (timeType == 2) {
          timeDataValue = dataValue
        } else if (timeType == 3) {
          timeDataValue = new Date().getTime()
        } else if (timeType == 4) {
          let previousDate = '';
          if (timeTarget == 1 || timeTarget == 2) {
            previousDate = getDateDay(timeTarget, timeType, timeValue)
            timeDataValue = new Date(previousDate).getTime()
          } else if (timeTarget == 3) {
            previousDate = getBeforeData(timeValue)
            timeDataValue = new Date(previousDate).getTime()
          } else {
            timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
          }
        } else if (timeType == 5) {
          let previousDate = '';
          if (timeTarget == 1 || timeTarget == 2) {
            previousDate = getDateDay(timeTarget, timeType, timeValue)
            timeDataValue = new Date(previousDate).getTime()
          } else if (timeTarget == 3) {
            previousDate = getLaterData(timeValue)
            timeDataValue = new Date(previousDate).getTime()
          } else {
            timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
          }
        }
      }
      return timeDataValue;
    },
    time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
      let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
      let timeDataValue = null
      if (timeRule) {
        if (timeType == 1) {
          timeDataValue = timeValue || '00:00:00'
          if (timeDataValue.split(':').length == 3) {
            timeDataValue = timeDataValue
          } else {
            timeDataValue = timeDataValue + ':00'
          }
        } else if (timeType == 2) {
          timeDataValue = dataValue
        } else if (timeType == 3) {
          timeDataValue = this.jnpf.toDate(new Date(), format)
        } else if (timeType == 4) {
          let previousDate = '';
          previousDate = getBeforeTime(timeTarget, timeValue)
          timeDataValue = this.jnpf.toDate(previousDate, format)
        } else if (timeType == 5) {
          let previousDate = '';
          previousDate = getLaterTime(timeTarget, timeValue)
          timeDataValue = this.jnpf.toDate(previousDate, format)
        }
      }
      return timeDataValue;
    },
    dataList() {
      var _data = this.dataForm;
      return _data;
    },
    dataInfo(dataAll) {
      let _dataAll = dataAll
      this.dataForm = _dataAll
      this.isEdit = true
      this.dataAll()
      for (let i = 0; i < _dataAll.fz_project_digital_budgetList.length; i++) {
        this.childIndex = i
      }
      for (let i = 0; i < _dataAll.fz_project_other_digital_budgetList.length; i++) {
        this.childIndex = i
      }
      this.childIndex = -1
    },
  },
}

</script>
<style lang="scss" scoped>
.main .project-main {
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1) !important;
  border: 1px solid #EBEEF5;
  padding: 20px;
  border-radius: 5px;

  .print-button {
    position: absolute;
    top: 0;
    right: 0;
  }
}

.project-table ::v-deep .el-upload__tip,
::v-deep .el-upload__tip {
  color: red;
}

.isLoan {
  margin-top: -72px;
  position: absolute;
  left: 90px;
}

.isLoan2 {
  margin-top: 0px;

  a {
    color: #1890ff;
  }
}

::v-deep .el-textarea__inner {
  min-height: 100px !important;
}

::v-deep .el-input-number--medium {
  width: 100% !important;
}
</style>
